
import BadRoomStepView0 from "../../badroom/view/BadRoomStepView0";
import { EventName, ActionType } from "../../../public/Config";
import GlobalEvent from "../../../cfw/event/GlobalEvent";

const { ccclass, property } = cc._decorator;

@ccclass
export default class BornStepView1 extends BadRoomStepView0 {

    @property(cc.Node)
    angle: cc.Node = null;

    collideLogic() {
        if (!cc.isValid(this.node)) {
            return;
        }        
        this.angle.active = false;
        GlobalEvent.instance().emit(EventName.CHANGE_PLAYER_ACTION,ActionType.SLEEP)
        cc.tween(this).to(3,{}).call(()=>{
            GlobalEvent.instance().emit(EventName.CHANGE_PLAYER_ACTION,ActionType.AWAKE)
            GlobalEvent.instance().emit(EventName.UPDATE_SLEEP_STEP, 3)
        }).start();
       
    }



}
